import * as http from "@/utils/request";

/**
 * 插入或更新产品分类信息
 * @param {Array} categories 产品分类信息数组
 * @returns Promise
 */
export function insertOrUpdateCategories(categories) {
  return http.post('/api/admin/ProductCategorie/InsertOrUpdate', categories);
}

/**
 * 获取全部产品分类信息
 * @returns Promise
 */
export function getAllProductCategories() {
  return http.get('/api/admin/ProductCategorie/GetAllProductCategorie');
}

/**
 * 根据ID删除一个产品分类
 * @param {number} id 产品分类ID
 * @returns Promise
 */
 export function deleteProductCategoryById(id) {
  return http.get(`/api/admin/ProductCategorie/DeleteProductCategorieById?id=${id}`);
}